home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Komputer for Alle 2003 Ekstra 100 Spil
/
K-CD_2003_Ekstra_100_Spil.iso
/
Board
/
4free
/
4free.exe
/
{app}
/
open4.txt
< prev
next >
Wrap
Text File
|
2002-01-29
|
9KB
|
174 lines
General Notes
=============
This game supports Open Line up 4. Basically, if you know how to
create a windows dll you can replace our computer player with your
own.
If you create a new 'Engine.dll' feel free to send it to us and,
if you agree, we may host it on our site for others to try.
Note that you may not redistribute this game for commercial purposes.
You may also not change the images or credits currently in the game.
If you wish to use a modified version of this game without our
credits images, or advertising dialog feel free to contact us.
If you program in C++, an empty ms developer studio project is included
with this install for convenience. The file is called emptyplayer.zip
and is in the root directory.
Technical Details
=================
Engine.dll must be located in a subdirectory under "[4Free root]\Engines" and have the following interface:
VOID WINAPI C4_Desc (char* pc, size_t size);
BOOL WINAPI C4_NewGame (long width, long height, long num);
BOOL WINAPI C4_PlayMove (long player, long column);
LONG WINAPI C4_AutoMove (long player, long level);
LONG WINAPI C4_GetState (long x, long y);
BOOL WINAPI C4_IsWinner (long player);
BOOL WINAPI C4_IsTie (void);
VOID WINAPI C4_WinCoords (long player, long* x1, long* y1, long* x2, long* y2);
VOID WINAPI C4_EndGame (void);
BOOL WINAPI C4_EnumLevels (long level, char* pc, size_t size);
The exported function names should be as exactly they are written here (C/C++ programmers should use a .DEF file to specify an undecorated function name).
The functions are described as follows:
1. VOID WINAPI C4_Desc (char* pc, size_t size)
/****************************************************************************/
/** **/
/** This function returns a brief description for the Engine that is to **/
/** be displayed in the 'options' dialog. **/
/** **/
/****************************************************************************/
2. BOOL WINAPI C4_NewGame (long width, long height, long unused)
/****************************************************************************/
/** **/
/** This function sets up a new game. This must be called exactly once **/
/** before each game is started. Before it can be called a second time, **/
/** C4_EndGame() must be called to destroy the previous game. **/
/** **/
/** width and height are the desired dimensions of the game board. **/
/** **/
/** This function returns TRUE if the game was successfully started, **/
/** FALSE otherwise. **/
/** **/
/****************************************************************************/
3. BOOL WINAPI C4_PlayMove (long player, long column)
/****************************************************************************/
/** **/
/** This function drops a piece of the specified player into the **/
/** specified column. Note that column numbering starts at 0. A value **/
/** of TRUE is returned if the drop was successful, or FALSE otherwise. **/
/** A drop is unsuccessful if the specified column number is invalid or **/
/** full. **/
/** **/
/****************************************************************************/
4. LONG WINAPI C4_AutoMove (long player, long level)
/****************************************************************************/
/** **/
/** This function instructs the computer to make a move for the specified **/
/** player. level specifies the 'level' option specified by the user in **/
/** the options dialog. The column number of the column in which **/
/** the piece was dropped is returned. Note that column numbering starts **/
/** at 0. If no move is possible (i.e. the game board is full), -1 is **/
/** returned. **/
/** **/
/****************************************************************************/
5. LONG WINAPI C4_GetState (long x, long y)
/****************************************************************************/
/** The board configuration of the game state. **/
/** C4_GetState(x,y) specifies the state of the **/
/** xth column and the yth row of the board, **/
/** where column and row numbering starts at 0. **/
/** (The 0th row is the bottom row.) **/
/** A value of C4_PLAYER0 specifies that the position is **/
/** occupied by a piece owned by player 0, a **/
/** value of C4_PLAYER1 specifies that the position is **/
/** occupied by a piece owned by player 1, and **/
/** a value of C4_NOPLAYER specifies that the **/
/** position is unoccupied. **/
/****************************************************************************/
6. BOOL WINAPI C4_IsWinner (long player)
/****************************************************************************/
/** **/
/** This function returns TRUE if the specified player has won the game, **/
/** and FALSE otherwise. **/
/** **/
/****************************************************************************/
7. BOOL WINAPI C4_IsTie (void)
/****************************************************************************/
/** **/
/** This function returns TRUE if the board is completely full and there **/
/** is no winner. FALSE otherwise. **/
/** **/
/****************************************************************************/
8. VOID WINAPI C4_WinCoords (long player, long* x1, long* y1, long* x2, long* y2)
/****************************************************************************/
/** **/
/** This function returns the coordinates of the winning connections of **/
/** the specified player. It is assumed that the specified player has **/
/** indeed won the game. The coordinates are returned in x1, y1, x2, y2, **/
/** where (x1, y1) specifies the starting piece of the winning **/
/** connection, and (x2, y2) specifies the ending piece of the **/
/** winning connection. If more than one winning connection exists, only **/
/** one will be returned. **/
/** **/
/****************************************************************************/
9. VOID WINAPI C4_EndGame (void)
/****************************************************************************/
/** **/
/** This function ends the current game. It is assumed that a game is **/
/** indeed in progress. It is illegal to call any other game function **/
/** immediately after this one except for C4_NewGame(). **/
/** **/
/****************************************************************************/
10. BOOL WINAPI C4_EnumLevels (long level, char* pc, size_t size)
/****************************************************************************/
/** **/
/** This function is used to learn about which skill levels the engine **/
/** supports. For example, if an engine supports three skill levels, 0-2 **/
/** then this function would return TRUE if 'level' >=0 and level < 3. **/
/** The value of pc might be "Easy", "Intermediate" and "Hard" for levels **/
/** 0, 1 and 2 respectively. **/
/** **/
/****************************************************************************/